<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head th:include="common/common.html::common_css">
</head>
<body>
<div th:replace="common/admin_common.html::common_sidebar"></div>
<div class="page">
    <div th:replace="common/admin_common.html::common_navbar"></div>
    <!-- Breadcrumb-->
    <div class="breadcrumb-holder">
        <div class="container-fluid">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a th:href="@{/admin/admin_index.html}">主页</a></li>
                <li class="breadcrumb-item"><a th:href="@{/admin/testlib_manage.html}">题库管理</a></li>
                <li class="breadcrumb-item"><a
                        th:href="@{/admin/testlib_information.html/{id}(id=${upquestion.apartmentid})}">题库详情</a></li>
                <li class="breadcrumb-item active">题目详情</li>
            </ul>
        </div>
    </div>
    <section>
        <div class="container-fluid">
            <!-- Page Header-->
            <header>
                <h1 class="h3 display">题目信息</h1>
            </header>
            <div class="row">
                <div class="col-lg-6" style="flex:100%;max-width: 100%">
                    <div class="card">
                        <div class="card-header">
                            <h4>题目</h4>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive" style="overflow-x:visible">
                                <form class="text-left form-validate" th:action="@{/admin/question_update.html}"
                                      method="post">
                                    <input type="hidden" name="questionid" th:value="${upquestion.questionid}">
                                    <div class="form-group-material">
                                        <label for="questionapartment" class="label-material"
                                               style="color: #aaaaaa;">部门</label>
                                        <select id="questionapartment" name="apartmentid" class="form-control"
                                                required data-msg="请选择部门">
                                            <option></option>
                                            <option th:each="apartments:${apartments}" th:selected="${upquestion.apartmentid==apartments.apartmentid}" th:value="${apartments.apartmentid}" th:text="${apartments.apartmentname}"></option>
                                        </select>
                                    </div>
                                    <div class="form-group-material">
                                        <input type="hidden" name="type" th:value="${upquestion.type}">
                                        <label class="label-material"
                                               style="color: #aaaaaa;">类型</label>
                                        <p th:if="${upquestion.type==1}">单 选 题</p>
                                        <p th:if="${upquestion.type==2}">多 选 题</p>
                                        <p th:if="${upquestion.type==3}">判 断 题</p>
                                    </div>
                                    <div class="form-group-material">
                                        <input id="questioncontent" type="text" name="content" class="input-material"
                                               data-msg="请输入题目内容" size="255"
                                               required="" th:value="${upquestion.content}">
                                        <label for="questioncontent" class="label-material">题目内容</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="optionA" type="text" name="optionA" class="input-material"
                                               th:value="${upquestion.optionA}">
                                        <label for="optionA" class="label-material">A选项</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="optionB" type="text" name="optionB" class="input-material"
                                               th:value="${upquestion.optionB}">
                                        <label for="optionB" class="label-material">B选项</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="optionC" type="text" name="optionC" class="input-material"
                                               th:value="${upquestion.optionC}">
                                        <label for="optionC" class="label-material">C选项</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="optionD" type="text" name="optionD" class="input-material"
                                               th:value="${upquestion.optionD}">
                                        <label for="optionD" class="label-material">D选项</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="optionE" type="text" name="optionE" class="input-material"
                                               th:value="${upquestion.optionE}">
                                        <label for="optionE" class="label-material">E选项</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="optionF" type="text" name="optionF" class="input-material"
                                               th:value="${upquestion.optionF}">
                                        <label for="optionF" class="label-material">F选项</label>
                                    </div>
                                    <div class="form-group-material" th:if="${upquestion.type==3}">
                                        <label class="label-material" style="color: #aaaaaa;">判断题答案</label>
                                        <div class="form-group terms-conditions text-center">
                                            <input name="judgeanswer" class="form-control-custom is-invalid"
                                                   id="judgeanswert"
                                                   aria-invalid="true" aria-describedby="registerAgree-error"
                                                   required=""
                                                   type="radio" value="1" data-msg="请设定答案"
                                                   th:checked="${upquestion.judgeanswer}">
                                            <label for="judgeanswert">正确</label>
                                            <input name="judgeanswer" class="form-control-custom is-invalid"
                                                   id="judgeanswerf"
                                                   aria-invalid="true" aria-describedby="registerAgree-error"
                                                   required=""
                                                   type="radio" value="0" data-msg="请设定答案"
                                                   th:checked="${not upquestion.judgeanswer}">
                                            <label for="judgeanswerf">错误</label>
                                        </div>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="answer" type="text" name="answer" class="input-material"
                                               data-msg="请设定答案"
                                               required="" th:value="${upquestion.answer}">
                                        <label for="answer" class="label-material">答案</label>
                                    </div>
                                    <div class="form-group-material"
                                         th:if="${upquestion.type==1 or upquestion.type==2}">
                                        <input id="point" type="text" name="point" class="input-material"
                                               data-msg="请设定答案"
                                               required="" th:value="${upquestion.point}">
                                        <label for="point" class="label-material">分值</label>
                                    </div>
                                    <div class="form-group text-center">
                                        <input sec:authorize="hasRole('Ctest')" style="border-radius: 4px;margin-right: 50px" id="questionadd" type="submit" value="更新" class="btn btn-primary">
                                        <a th:href="@{/admin/testlib_information.html/{id}(id=${upquestion.apartmentid})}"
                                           type="button" class="btn btn-warning m-b-10 m-1-5"
                                           style="border-radius: 4px;">返回</a>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div th:replace="common/common.html::common_footer"></div>
</div>
<div th:replace="common/common.html::common_js">
</div>
</body>
</html>